package cn.com.yinhex.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateHelp {
    public static String getBeforeDate(Date date,int days)
    {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        Date beforeDate = new Date(date.getTime() - days * 24 * 60 * 60 * 1000);
        return df.format(beforeDate);
    }
    
    public static String getAfterDate(Date date,int days)
    {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        Date beforeDate = new Date(date.getTime() + days * 24 * 60 * 60 * 1000);
        return df.format(beforeDate);
    }

}
